package com.auto.survey.net.repository

import com.auto.survey.net.NetworkConfig
import com.auto.survey.net.api.ApiService
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers

class UserRepository {

    private val apiService: ApiService by lazy {
        NetworkConfig.createService(ApiService::class.java)
    }

    fun getUser(username: String) = apiService.getUser(username)
        .subscribeOn(Schedulers.io())
        .observeOn(AndroidSchedulers.mainThread())
}